﻿using AutoMapper;
using Tauren.Business.Entity.Const;

namespace Tauren.Business.Mapper
{

    public class TenantInformationProfile : Profile, ICommProfile
    {
        public TenantInformationProfile()
        {
            InitProfile();
        }

        public void InitProfile()
        {
            CreateMap<Entity.Model.TenantInformation, Entity.Output.TenantInformation_Output>().AfterMap((data, viw) => {
                viw.Dic_CreatDate = data.CreatDate is null? "" : data.CreatDate.Value.ToString(GlobalConst.DATE_FORMAT_MINUTES);
                viw.Dic_ExPirationDate = data.ExPirationDate is null ? "" : data.ExPirationDate.Value.ToString(GlobalConst.DATE_FORMAT_SECONDS);
            }) ;
            CreateMap<Entity.Input.TenantInformation_Input, Entity.Model.SystemLog>();
        }
    }
}
